Why do you have to mark a class with the attribute [serializable] ?

Posted by Blankman on Stack Overflow See other posts from Stack Overflow or by Blankman
Published on 2010-04-07T18:57:39Z Indexed on 2010/04/07 19:03 UTC
Read the original article Hit count: 230

Filed under:
|

Seeing as you can convert any document to a byte array and save it to disk, and then rebuild the file to its original form (as long as you have meta data for its filename etc.).

Why do you have to mark a class with [Serializable] etc? Is that just the same idea, "meta data" type information so when you cast the object to its class things are mapped properly?

© Stack Overflow or respective owner

Related posts about c#

Related posts about serialization